﻿Public Class clsGjbMst

    Public Function getAllList(material_code As String) As DataTable
        Dim dt As DataTable = New DataTable
        Dim szSql As String = String.Empty
        szSql &= "SELECT * FROM sf.t_mst_gjb "
        szSql &= " WHERE 1 = 1 "
        If material_code.Length > 0 Then
            szSql &= " and material_code = ? "
            dt = DBacs.ExecuteSql(szSql, -1, material_code)
        Else
            dt = DBacs.ExecuteSql(szSql, -1)
        End If
        Return dt
    End Function

    Public Function selectAll(mst_value As String) As DataTable
        Dim dt As DataTable = New DataTable
        Dim szSql As String = String.Empty
        szSql &= "SELECT *,mst_value || ' (' || material_code  || ')' as mst_value_name FROM sf.t_mst_gjb "
        szSql &= " WHERE 1 = 1 "
        If mst_value.Length > 0 Then
            szSql &= " and mst_value = ? "
            dt = DBacs.ExecuteSql(szSql, -1, mst_value)
        Else
            dt = DBacs.ExecuteSql(szSql, -1)
        End If
        Return dt
    End Function
End Class
